<?php
namespace core;
use core\Request;
class App{

	public static function run() {

		$request = Request::init();
		
		// 获得路径
		$path = $request->path();
		list($url, $params) = $request->parseUrl($path);
		// 实例化control
		try {
			$class_action = explode('/', $url);
			$class = $class_action[0];
			$class = ucfirst($class);
			$class = 'app\\controller\\' . $class;
			$action = $class_action[1];
			$app = new $class();
			$app->$action();
		} catch (Exception $e) {
			var_dump($e);
		}

	}
}